package com.sw.bbs.common.vo;

import io.swagger.annotations.ApiModelProperty;

public class JsonMessage<T>
{
    
    public static String SUCCESS = "SUCCESS";
    public static String FAIL = "FAIL";
    @ApiModelProperty(name = "code", value = "处理结果代码，200表示成功，其他表示失败")
    Integer status = 200;
    
    @ApiModelProperty(name = "text", value = "错误信息")
    String text = SUCCESS;
    
    @ApiModelProperty(name = "data", value = "处理数据")
    T data;
    
    public JsonMessage()
    {
        super();
    }
    
    public JsonMessage(T data)
    {
        this(200, SUCCESS, data);
    }
    
    public JsonMessage(Integer status, String text, T data)
    {
        super();
        this.status = status;
        this.text = text;
        this.data = data;
    }
    
     
    
    public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getText()
    {
        return this.text;
    }
    
    public void setText(String text)
    {
        this.text = text == null ? null : text.trim();
    }

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}
    
}
